#ifndef ICAPTURESTRATEGY_H
#define ICAPTURESTRATEGY_H

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <QGroupBox>
#include <QLabel>
#include <QButtonGroup>
#include <QPushButton>
#include <QTextEdit>
#include <math.h>
#include <QLineEdit>
#include <QAbstractButton>
#include <QFileDialog>
#include <QMessageBox>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <QSplineSeries>
#include <QScatterSeries>
#include <QChart>
#include <QChartView>
#include <QTimer>
#include <QTimerEvent>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <iostream>
#include <qtimer.h>
#include <opencv2/core/core.hpp>
#include <math.h>
#include <QDebug>
#include <QHBoxLayout>
#include <QDateTime>
#include <QComboBox>

extern cv::Mat imgMinusAvg(cv::Mat frame);

class ICaptureStrategy
{
public:
    ICaptureStrategy(int w, int h);
    ICaptureStrategy() = default;
    virtual ~ICaptureStrategy();

    virtual int prepareVideoCapture() = 0;
    virtual int getFrame(cv::Mat& frame) = 0;
    virtual int getFrameIndex();
    virtual void setFrameIndex(int index);
    virtual int getFrameTotal();
    virtual void frameForward();
    virtual void frameBackoff();
    int AnalyzeTheRainfallTrend(cv::Mat& gray);
    int GetCurrentValidPixels(cv::Mat frame, cv::Mat baseFrame);

protected:


    cv::VideoCapture itsVideo;
    cv::Mat itsBaseImage;
    int itsWidth;
    int itsHeight;
};

#endif // ICAPTURESTRATEGY_H
